package com.share.shareplatform.pojo;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;

@Data
@NoArgsConstructor
@AllArgsConstructor
public class Brand {
    private Long id;
    @NotBlank(message = "名称不能为空")
    @Length(max=20,message ="名称太长")
    private String name;
    @Min(value = 0,message = "访问量不能小于0")
    private Integer visit;//访问次数（作为品牌热度）

    public static void setInit(Brand brand){
        brand.setVisit(0);
    }
}
